package lxh.com.union.logic_business.present;

import com.google.gson.Gson;
import com.lzy.okgo.OkGo;
import com.lzy.okgo.callback.StringCallback;
import com.lzy.okgo.model.Response;

import lxh.com.union.frame.mvp.BasePresent;
import lxh.com.union.logic_business.model.bean.BaseBean;
import lxh.com.union.logic_business.model.bean.ClassifyBean;
import lxh.com.union.logic_business.model.bean.OrderCountBean;
import lxh.com.union.logic_business.model.net.INetCallBack;
import lxh.com.union.logic_business.model.net.MyCallBack;
import lxh.com.union.logic_business.model.net.UrlConstant;
import lxh.com.union.logic_business.ui.mvpview.IClassifyView;
import lxh.com.union.logic_business.util.ToastUtils;

/**
 * Created by Administrator on 2017/11/28.
 */

public class ClassifyPresent extends BasePresent<IClassifyView> {

    public void loadClassifyData(){
        OkGo.<String>get(UrlConstant.CLASSIFY_DATA)
                .tag(this).execute(new MyCallBack(ClassifyBean.class, new INetCallBack() {
            @Override
            public void success(Object o) {
                getView().getClassifyData((ClassifyBean) o);
            }

            @Override
            public void failed(Object o) {
                ToastUtils.showLong(o.toString());
            }
        }));
    }
}
